<template>
	<view :style="{height:pageHeight}" class="bodyPage">
		<web-view ref="web" v-if="isShow==1" id="iframe" :src="pagePath" style="height:100%;margin-top:10rpx;" />
	</view>
</template>

<script>
	import {
		doElectroicContract
	} from '@/api/directSelling.js';
	import {
		shop_ht,
	} from '@/config/app_member.js';
	export default {
		data() {
			return {
				// #ifdef H5 || MP
				pageHeight: '667px',
				// #endif
				// #ifdef APP-PLUS
				//pageHeight: app.globalData.windowHeight,
				pageHeight: '667px',
				// #endif
				footerStatus: true,
				pagePath: "",
				isShow: 0,
				navTitle: "会员系统"
			};
		},
		created() {},
		onReady() {
			let _this = this;
			uni.getSystemInfo({
				success(e) {
					_this.pageHeight = e.windowHeight;
				}
			});
			console.log("aaaa");
		},
		onLoad() {

		},
		created() {
			console.log("ccccc");
			this.submitElectroicContract();

			//var currentWebview = this.$refs.web.$getAppWebview(); //获取当前页面的webview对象
			//console.log(currentWebview);
		},
		methods: {
			//获取签约流程
			submitElectroicContract() {
				let postData = {
					token: this.$w_md5.hex_md5_32Upper('invoTlSetvise' + uni.getStorageSync('userInfo').memberCode),
					memberCode: uni.getStorageSync('userInfo').memberCode,
					memberType: 3
				};
				let parse = "?token=" + postData.token + "&memberCode=" + postData.memberCode + "&memberType=" + postData
					.memberType
				uni.request({
					url: shop_ht + '/shop_ht/vt/invoTlSetvise.do' + parse,
					method: "get",
					success: (res) => {
						if (res.data.status == 1) {
							this.isShow = 1;
							this.pagePath = res.data.Url;
						} else {
							this.$util.Tips({
								title: `${res.data.msg}`
							});
						}
					}
				})
			}
		}
	};
</script>

<style lang="scss">
	.agreement{
		display:none!important;
	}
</style>
